var express = require('express');
var router = express.Router();

/* GET users listing. */
router.get('/', function(req, res, next) {
  res.send('respond with a resource');
});

router.get("/list", function(req, res, next){
	res.send('user list');
});
 
//还可以写正则表达式
router.get("/ab*cd", function(req, res, next){
	res.send("regexp");
})
 
//加载form表单页面
router.get("/form", function(req, res){
	res.sendFile(__dirname + "/form.html");
})
 
router.post("/save", function(req, res){
	res.send("表单提交");
})

//同时接收get和post请求
router.all("/all", function(req, res){
	res.send("all");
})

module.exports = router;



